﻿/*
*
*
*/
Ext.define('VTV.TaDMS.Extjs.Model.Task', {
    extend: 'Ext.data.Model',
    fields: [{
        name: 'TaskId', mapping: 'TaskId', type: 'int'
    }, {
        name: 'CreateBy', mapping: 'CreateBy', type: 'int'
    }, {
        name: 'TaskName', mapping: 'TaskName', type: 'string'
    }, {
        name: 'TaskType', mapping: 'TaskType', type: 'string'
    }, {
        name: 'StartDate', mapping: 'StartDate', type: 'date'
    }, {
        name: 'EndDate', mapping: 'EndDate', type: 'date'
    }, {
        name: 'ActualEndDate', mapping: 'ActualEndDate', type: 'date'
    }, {
        name: 'Status', mapping: 'Status', type: 'int'
    }, {
        name: 'Descriptions', mapping: 'Descriptions', type: 'string'
    }, {
        name: 'CreateDate', mapping: 'CreateDate', type: 'date'
    }],
    idProperty: 'TaskId',
    hasMany: { model: 'VTV.TaDMS.Extjs.Model.TaskEmployee', name: 'TaskEmployees' }
});

/*
*
*
*/
Ext.define('VTV.TaDMS.Extjs.Model.TaskEmployee', {
    extend: 'Ext.data.Model',
    fields: [{
        name: 'TaskId', mapping: 'TaskId', type: 'int'
    }, {
        name: 'EmployeeId', mapping: 'EmployeeId', type: 'int'
    }, {
        name: 'Status', mapping: 'Status', type: 'string'
    }, {
        name: 'Report', mapping: 'Report', type: 'string'
    }, {
        name: 'Notes', mapping: 'Notes', type: 'string'
    }, {
        name: 'Comments', mapping: 'Comments', type: 'string'
    }],
    belongsTo: 'VTV.TaDMS.Extjs.Model.Task'
});

/*
*
*
*/
Ext.define('VTV.TaDMS.Extjs.Model.Department', {
    extend: 'Ext.data.Model',
    fields: [{
        name: 'DepartmentId', mapping: 'DepartmentId', type: 'int'
    }, {
        name: 'ParentDepartmentId', mapping: 'ParentDepartmentId', type: 'int'
    }, {
        name: 'DepartmentLevel', mapping: 'DepartmentLevel', type: 'int'
    }, {
        name: 'DepartmentName', mapping: 'DepartmentName', type: 'string'
    }, {
        name: 'Note', mapping: 'Note', type: 'string'
    }]
});

/*
*
*
*/
Ext.define('VTV.TaDMS.Extjs.Model.Employee', {
    extend: 'Ext.data.Model',
    fields: [{
        name: 'EmployeeId', mapping: 'EmployeeId', type: 'int'
    }, {
        name: 'DepartmentId', mapping: 'DepartmentId', type: 'int'
    }, {
        name: 'FirstName', mapping: 'FirstName', type: 'string'
    }, {
        name: 'LastName', mapping: 'LastName', type: 'string'
    }, {
        name: 'BirthDate', mapping: 'BirthDate', type: 'date'
    }, {
        name: 'Address', mapping: 'Address', type: 'string'
    }, {
        name: 'MobilePhone', mapping: 'MobilePhone', type: 'string'
    }, {
        name: 'Email', mapping: 'Email', type: 'string'
    }, {
        name: 'Note', mapping: 'Note', type: 'string'
    }],
    idProperty: 'EmployeeId'
});
